import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Forum from '../pages/forum/list'
import ForumAdd from '../pages/forum/add'
import ForumDetail from '../pages/forum/detail'
import MyForumList from '../pages/forum/myForumList'
import ExamPaper from '../pages/exam/examPaper'
import Exam from '../pages/exam/exam'
import ExamList from '../pages/exam/examList'
import ExamRecord from '../pages/exam/examRecord'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import payList from '../pages/pay'

import yonghuList from '../pages/yonghu/list'
import yonghuDetail from '../pages/yonghu/detail'
import yonghuAdd from '../pages/yonghu/add'
import putongguanliyuanList from '../pages/putongguanliyuan/list'
import putongguanliyuanDetail from '../pages/putongguanliyuan/detail'
import putongguanliyuanAdd from '../pages/putongguanliyuan/add'
import kemuleibieList from '../pages/kemuleibie/list'
import kemuleibieDetail from '../pages/kemuleibie/detail'
import kemuleibieAdd from '../pages/kemuleibie/add'
import mingshijiaoxueList from '../pages/mingshijiaoxue/list'
import mingshijiaoxueDetail from '../pages/mingshijiaoxue/detail'
import mingshijiaoxueAdd from '../pages/mingshijiaoxue/add'
import zhaoshengxinxiList from '../pages/zhaoshengxinxi/list'
import zhaoshengxinxiDetail from '../pages/zhaoshengxinxi/detail'
import zhaoshengxinxiAdd from '../pages/zhaoshengxinxi/add'
import newstypeList from '../pages/newstype/list'
import newstypeDetail from '../pages/newstype/detail'
import newstypeAdd from '../pages/newstype/add'
import systemintroList from '../pages/systemintro/list'
import systemintroDetail from '../pages/systemintro/detail'
import systemintroAdd from '../pages/systemintro/add'
import discussmingshijiaoxueList from '../pages/discussmingshijiaoxue/list'
import discussmingshijiaoxueDetail from '../pages/discussmingshijiaoxue/detail'
import discussmingshijiaoxueAdd from '../pages/discussmingshijiaoxue/add'
import discusszhaoshengxinxiList from '../pages/discusszhaoshengxinxi/list'
import discusszhaoshengxinxiDetail from '../pages/discusszhaoshengxinxi/detail'
import discusszhaoshengxinxiAdd from '../pages/discusszhaoshengxinxi/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'pay',
					component: payList,
				},
				{
					path: 'forum',
					component: Forum
				},
				{
					path: 'forumAdd',
					component: ForumAdd
				},
				{
					path: 'forumDetail',
					component: ForumDetail
				},
				{
					path: 'myForumList',
					component: MyForumList
				},
				{
					path: 'examPaper',
					component: ExamPaper
				},
				{
					path: 'examList',
					component:ExamList
				},
				{
					path: 'examRecord/:type',
					component:ExamRecord
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'yonghu',
					component: yonghuList
				},
				{
					path: 'yonghuDetail',
					component: yonghuDetail
				},
				{
					path: 'yonghuAdd',
					component: yonghuAdd
				},
				{
					path: 'putongguanliyuan',
					component: putongguanliyuanList
				},
				{
					path: 'putongguanliyuanDetail',
					component: putongguanliyuanDetail
				},
				{
					path: 'putongguanliyuanAdd',
					component: putongguanliyuanAdd
				},
				{
					path: 'kemuleibie',
					component: kemuleibieList
				},
				{
					path: 'kemuleibieDetail',
					component: kemuleibieDetail
				},
				{
					path: 'kemuleibieAdd',
					component: kemuleibieAdd
				},
				{
					path: 'mingshijiaoxue',
					component: mingshijiaoxueList
				},
				{
					path: 'mingshijiaoxueDetail',
					component: mingshijiaoxueDetail
				},
				{
					path: 'mingshijiaoxueAdd',
					component: mingshijiaoxueAdd
				},
				{
					path: 'zhaoshengxinxi',
					component: zhaoshengxinxiList
				},
				{
					path: 'zhaoshengxinxiDetail',
					component: zhaoshengxinxiDetail
				},
				{
					path: 'zhaoshengxinxiAdd',
					component: zhaoshengxinxiAdd
				},
				{
					path: 'newstype',
					component: newstypeList
				},
				{
					path: 'newstypeDetail',
					component: newstypeDetail
				},
				{
					path: 'newstypeAdd',
					component: newstypeAdd
				},
				{
					path: 'systemintro',
					component: systemintroList
				},
				{
					path: 'systemintroDetail',
					component: systemintroDetail
				},
				{
					path: 'systemintroAdd',
					component: systemintroAdd
				},
				{
					path: 'discussmingshijiaoxue',
					component: discussmingshijiaoxueList
				},
				{
					path: 'discussmingshijiaoxueDetail',
					component: discussmingshijiaoxueDetail
				},
				{
					path: 'discussmingshijiaoxueAdd',
					component: discussmingshijiaoxueAdd
				},
				{
					path: 'discusszhaoshengxinxi',
					component: discusszhaoshengxinxiList
				},
				{
					path: 'discusszhaoshengxinxiDetail',
					component: discusszhaoshengxinxiDetail
				},
				{
					path: 'discusszhaoshengxinxiAdd',
					component: discusszhaoshengxinxiAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
		{
			path: '/exam',
			component: Exam
		}
	]
})
